From 33473e9080a5343e1444f2321d6af57e7d68cbbb Mon Sep 17 00:00:00 2001 From: tsteven4 <13596209+tsteven4@users.noreply.github.com> Date: Thu, 29 Dec 2022 07:54:42 -0700 Subject: [PATCH] move gbfile.h, zlib.h out of defs.h. (#963) * move gbfile.h, zlib.b out of defs.h. * fix comment --- defs.h | 9 --------- garmin_xt.cc | 11 ++++++++++- gbfile.cc | 1 + gbfile.h | 7 +++++-- geo.cc | 18 ++++++++++++++---- gtm.cc | 15 ++++++++++++--- navilink.cc | 22 +++++++++++++++++++--- sbn.cc | 11 ++++++++++- sbp.cc | 9 ++++++++- skytraq.cc | 33 +++++++++++++++++---------------- tpg.cc | 11 ++++++++++- vcf.cc | 13 +++++++++---- 12 files changed, 115 insertions(+), 45 deletions(-) diff --git a/defs.h b/defs.h index c6778ee7f..030880260 100644 --- a/defs.h +++ b/defs.h @@ -19,9 +19,7 @@ #ifndef DEFS_H_INCLUDED_ #define DEFS_H_INCLUDED_ -#include // for sort, stable_sort #include // for M_PI -#include // for va_list #include // for NULL, nullptr_t, size_t #include // for int32_t, uint32_t #include // for NULL, fprintf, FILE, stdout @@ -29,12 +27,6 @@ #include // for optional #include // for move -#if HAVE_LIBZ -#include // doesn't really belong here, but is missing elsewhere. -#elif !ZLIB_INHIBITED -#include "zlib.h" // doesn't really belong here, but is missing elsewhere. -#endif - #include // for QDateTime #include // for QDebug #include // for QList, QList<>::const_iterator, QList<>::const_reverse_iterator, QList<>::count, QList<>::reverse_iterator @@ -49,7 +41,6 @@ #include "formspec.h" // for FormatSpecificData #include "inifile.h" // for inifile_t -#include "gbfile.h" // doesn't really belong here, but is missing elsewhere. #include "session.h" // for session_t #include "src/core/datetime.h" // for DateTime diff --git a/garmin_xt.cc b/garmin_xt.cc index 3a6c4b13a..6c179f74f 100644 --- a/garmin_xt.cc +++ b/garmin_xt.cc @@ -23,7 +23,16 @@ */ -#include "defs.h" +#include // for uint8_t, uint32_t, uint16_t, int32_t +#include // for SEEK_CUR, SEEK_SET +#include // for strcmp, strcpy + +#include // for QString +#include // for QVector + +#include "defs.h" // +#include "gbfile.h" // for gbfread, gbfgetuint16, gbfseek, gbfgetc, gbfgetu... + #define MYNAME "Garmin_XT" #define GARMIN_XT_ELE 31500/65536 diff --git a/gbfile.cc b/gbfile.cc index a2c86b28c..d3d6b9ec4 100644 --- a/gbfile.cc +++ b/gbfile.cc @@ -22,6 +22,7 @@ #include // for QByteArray #include // for QChar, operator==, operator!= +#include // for QDebug #include // for QString #include // for qPrintable diff --git a/gbfile.h b/gbfile.h index 2e2d0460b..24be29378 100644 --- a/gbfile.h +++ b/gbfile.h @@ -26,11 +26,14 @@ #include // for QByteArray #include // for QString -#include // for va_list #include // for int32_t, int16_t, uint32_t #include // for FILE -#include "defs.h" +#if HAVE_LIBZ +#include +#elif !ZLIB_INHIBITED +#include "zlib.h" +#endif struct gbfile; diff --git a/geo.cc b/geo.cc index da6eaa54a..f9999afe1 100644 --- a/geo.cc +++ b/geo.cc @@ -16,11 +16,21 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + +#include // for QByteArray +#include // for QIODevice +#include // for QString, operator==, QStringView::to... +#include // for QStringView +#include // for QVector +#include // for QXmlStreamAttributes +#include // for QXmlStreamReader +#include // for QXmlStreamWriter, QXmlStreamReader::... +#include // for qPrintable, QIODeviceBase::ReadOnly + #include "defs.h" -#include "src/core/file.h" -#include -#include -#include +#include "gbfile.h" // for gbfclose, gbfopen, gbfputs, gbfile +#include "src/core/file.h" // for File + static char* deficon = nullptr; static char* nuke_placer; diff --git a/gtm.cc b/gtm.cc index 6e864d00e..2a0a71c33 100644 --- a/gtm.cc +++ b/gtm.cc @@ -24,9 +24,18 @@ * https://www.trackmaker.com/download/GTM211_format.pdf */ -#include "defs.h" -#include "jeeps/gpsmath.h" -#include +#include // for SEEK_CUR +#include // for strlen, memset + +#include // for QList +#include // for QString +#include // for QVector + +#include "defs.h" +#include "gbfile.h" // for gbfseek, gbfputc, gbfputint32, gbfputflt +#include "jeeps/gpsmath.h" // for GPS_Math_Known_Datum_To_WGS84_M +#include "src/core/datetime.h" // for DateTime + static gbfile* file_in, *file_out; static int indatum; diff --git a/navilink.cc b/navilink.cc index 69cc94a0e..494bd210b 100644 --- a/navilink.cc +++ b/navilink.cc @@ -22,11 +22,27 @@ /* Based on description at http://wiki.splitbrain.org/navilink */ + +#include // for gmtime, time_t +#include // for memcpy, memset, strncpy + +#include // for QByteArray +#include // for QDate +#include // for QDateTime +#include // for QString, operator== +#include // for QThread +#include // for QTime +#include // for QVector +#include // for qPrintable, UTC + #include "defs.h" -#include "gbser.h" -#include "jeeps/gpsmath.h" #include "navilink.h" -#include +#include "gbfile.h" // for gbfwrite, gbfclose, gbfopen, gbfread +#include "gbser.h" // for gbser_read_wait, gbser_deinit, gbs... +#include "jeeps/gpsmath.h" // for GPS_Math_WGS84_To_UTM_EN +#include "jeeps/gpsport.h" // for int32 +#include "src/core/datetime.h" // for DateTime + #define MYNAME "NAVILINK" diff --git a/sbn.cc b/sbn.cc index 6a2658ef6..8d81b9f49 100644 --- a/sbn.cc +++ b/sbn.cc @@ -19,8 +19,17 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ +#include // for tm +#include // for size_t, memcpy + +#include // for QString +#include // for QVector +#include // for Q_UNUSED + #include "defs.h" -#include "navilink.h" +#include "gbfile.h" // for gbfread, gbfclose, gbfeof, gbfopen +#include "navilink.h" // for navilink_checksum_packet, locosys_... + #define MYNAME "sbn" diff --git a/sbp.cc b/sbp.cc index d808ca63b..6f9ccd24b 100644 --- a/sbp.cc +++ b/sbp.cc @@ -20,8 +20,15 @@ */ +#include // for size_t + +#include // for QString +#include // for QVector + #include "defs.h" -#include "navilink.h" +#include "gbfile.h" // for gbfread, gbfclose, gbfopen, gbfile +#include "navilink.h" // for locosys_decode_file_id, navilink_decode_logpoint + #define MYNAME "sbp" diff --git a/skytraq.cc b/skytraq.cc index dcccda94f..691e2b99b 100644 --- a/skytraq.cc +++ b/skytraq.cc @@ -23,23 +23,24 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ +#include // for isprint +#include // for cos, sin, atan2, pow, sqrt, M_PI +#include // for va_end, va_list, va_start +#include // for sscanf, snprintf, vprintf, SEEK_SET +#include // for free +#include // for memset +#include // for time, time_t + +#include // for QByteArray +#include // for QChar +#include // for QLatin1Char +#include // for QThread +#include // for qPrintable + +#include "defs.h" #include "skytraq.h" - -#include // for QByteArray -#include // for qPrintable -#include // for QLatin1Char -#include // for QThread - -#include // for isprint -#include // for cos, sin, atan2, pow, sqrt, M_PI -#include // for va_end, va_list, va_start -#include // for sscanf, snprintf, vprintf, SEEK_SET -#include // for free -#include // for memset -#include // for time, time_t - -#include "defs.h" // for fatal, le_readu32, Waypoint, be_write32, be_read16, be_read_double, be_write16, be_write_double, warning, KPH_TO_MPS, le_readu16, le_write_double, track_add_head, track_add_wpt, waypt_add, xfree, xmalloc, route_head, xasprintf, SECONDS_PER_DAY, WAYPT_SET, globa... -#include "gbser.h" // for gbser_set_speed, gbser_OK, gbser_deinit, gbser_flush, gbser_init, gbser_read_wait, gbser_readc_wait, gbser_writec +#include "gbfile.h" // for gbfclose, gbfopen, gbfread, gbfseek, gbfwrite +#include "gbser.h" // for gbser_set_speed, gbser_OK, gbser_deinit #define MYNAME "skytraq" diff --git a/tpg.cc b/tpg.cc index 46e812e54..66ed4792b 100644 --- a/tpg.cc +++ b/tpg.cc @@ -22,8 +22,17 @@ */ +#include // for isalnum +#include // for memcmp + +#include // for QChar +#include // for QString +#include // for QVector + #include "defs.h" -#include "jeeps/gpsmath.h" /* for datum conversions */ +#include "gbfile.h" // for gbfwrite, gbfgetint16, gbfputint16, gbfclose +#include "jeeps/gpsmath.h" // for GPS_Lookup_Datum_Index, GPS_Math_Known_Da... + #define MYNAME "TPG" diff --git a/vcf.cc b/vcf.cc index fb62ab1b6..209b46713 100644 --- a/vcf.cc +++ b/vcf.cc @@ -18,11 +18,16 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ +#include // for fabs +#include // for abs + +#include // for QString +#include // for QVector +#include // for CaseInsensitive + #include "defs.h" -#include "jeeps/gpsmath.h" -#include -#include -#include +#include "gbfile.h" // for gbfprintf, gbfputs, gbfclose, gbfopen, gbfile + static gbfile* file_out; static short_handle mkshort_handle; -- 2.30.2